package com.sykj.bsc.rwl.util;

import org.apache.log4j.Logger;

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisPoolWriper {
	 /** Redis连接池对象 */
    private JedisPool jedisPool;
    //, final String password
    private Logger logger = Logger.getLogger(String.valueOf(JedisClientPool.class));
    public JedisPoolWriper(final JedisPoolConfig poolConfig, final String host,
            final int port ,int timeout) {
        try {
            jedisPool = new JedisPool(poolConfig, host, port,timeout);
        } catch (Exception e) {
           logger.info("redis服务未连接......");
        }
    }
    
    /**
     * 获取Redis连接池对象
     * @return
     */
    public JedisPool getJedisPool() {
        return jedisPool;
    }

    /**
     * 注入Redis连接池对象
     * @param jedisPool
     */
    public void setJedisPool(JedisPool jedisPool) {
        this.jedisPool = jedisPool;
    }

}
